<template>
	<view class="paper-container">
		<view class="paper-countdown">
			<u-count-down :time="paperDetail.suggestTime * 60 * 1000" format="HH:mm:ss"></u-count-down>
		</view>
		<view class="paper-head">
			<view class="paper-name">{{paperDetail.name}}</view>
			<view class="paper-score-time">
				<text>试卷总分：{{paperDetail.score}}</text>
				<text>考试时间：{{paperDetail.suggestTime}}分钟</text>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '../../http'
	export default {
		data() {
			return {
				paperDetail: []
			}
		},
		methods: {
			getDetail(id) {
				http({
					url: '/api/student/exam/paper/select/' + id,
					method: 'POST'
				}).then(res => {
					console.log(res);
					this.paperDetail = res.response
				})
			}
		},
		onLoad(option) {
			this.getDetail(option.id)
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}

	.paper-container {
		height: 100%;

		.paper-countdown {
			height: 80rpx;
			background-color: #45C4DD;
			display: flex;
			justify-content: center;
			align-items: center;

			text {
				color: #FFFFFF;
			}
		}

		.paper-head {
			.paper-name {
				height: 100rpx;
				text-align: center;
				line-height: 100rpx;
				font-size: 40rpx
			}

			.paper-score-time {
				height: 80rpx;
				border-bottom: #F5F5F5 1rpx solid;
				display: flex;
				justify-content: center;

				text {
					margin-right: 30rpx;
				}
			}
		}
	}
</style>